Skip to content

Migration Guide > key attribute の翻訳 #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2020

Conversation

ryoAccount
Copy link
Collaborator

resolve #120

翻訳対象のファイルが fork 時点での vuejs.org にはないため、
本家の↓こちらを翻訳しています。
https://github.com/vuejs/docs-next/blob/master/src/guide/migration/key-attribute.md

@netlify
Copy link

netlify bot commented Oct 22, 2020

Deploy preview for vuejs-v3-ja-doc-preview ready!

Built with commit d05ecfd

https://deploy-preview-143--vuejs-v3-ja-doc-preview.netlify.app

@ryoAccount
Copy link
Collaborator Author

@egurinko
レビューお願い致します。

@potato4d potato4d requested review from potato4d and egurinko October 26, 2020 03:28
@potato4d potato4d assigned potato4d and ryoAccount and unassigned potato4d Oct 26, 2020
Copy link
Member

@potato4d potato4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PRありがとうございます!

何点か、修正お願いします。

## 概要

- **新着:** Vue が一意の `key` を自動的に生成するようになったため、`v-if`/`v-else`/`v-else-if` 分岐で `key` が不要になりました。
- **速報:** 手動で `key` を指定する場合、各分岐は一意の `key` を使用する必要があります。 同じ `key` を意図的に使用して分岐を強制的に再利用することはできなくなりました。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **速報:** 手動で `key` を指定する場合、各分岐は一意の `key` を使用する必要があります。 同じ `key` を意図的に使用して分岐を強制的に再利用することはできなくなりました。
- **破壊的変更:** 手動で `key` を指定する場合、各分岐は一意の `key` を使用する必要があります。 同じ `key` を意図的に使用して分岐を強制的に再利用することはできなくなりました。

Breaking は破壊的変更(Breaking Changes)の意味なので、速報ではなく 破壊的 または 破壊的変更 で良いかと

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

破壊的変更 に修正しました
d05ecfd


- **新着:** Vue が一意の `key` を自動的に生成するようになったため、`v-if`/`v-else`/`v-else-if` 分岐で `key` が不要になりました。
- **速報:** 手動で `key` を指定する場合、各分岐は一意の `key` を使用する必要があります。 同じ `key` を意図的に使用して分岐を強制的に再利用することはできなくなりました。
- **速報:** `<template v-for>` における `key` は、`<template>` タグに配置する必要があります(子の要素ではない)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

破壊的変更 に修正しました
d05ecfd


## 背景

`key` 属性はノードの ID を追跡するために Vue の仮想 DOM のアルゴリズムのヒントとして使用されます。 こうすることで Vue は既存のノードを再利用してパッチを適用できる時期と、ノードを並べ替えまたは再作成する必要がある時期を識別します。 詳細については、次のセクションを参照してください。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

special の訳抜け?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文頭を 特別な属性である key は~ に修正しました
d05ecfd

「key特別属性」だと違和感を感じたので、意図的に special を除いていました。

<div v-else key="no">No</div>
```

上記の例は、Vue3.x でも機能します。 ただし、`v-if` / `v-else` / `v-else-if` 分岐で `key` 属性を使用することはお勧めしません。条件分岐で `key` を指定しない場合、一意となる `key` が自動的に生成されるようになったためです。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
上記の例は、Vue3.x でも機能します。 ただし、`v-if` / `v-else` / `v-else-if` 分岐で `key` 属性を使用することはお勧めしません。条件分岐で `key` を指定しない場合、一意となる `key` が自動的に生成されるようになったためです。
上記の例は、Vue3.x でも機能します。 ただし、`v-if` / `v-else` / `v-else-if` 分岐で `key` 属性を使用することはおすすめしません。条件分岐で `key` を指定しない場合、一意となる `key` が自動的に生成されるようになったためです。

漢字は開いたほうが読みやすいかと 📝

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おすすめ に修正しました。
d05ecfd

<div v-else>No</div>
```

重大な変更は手動で `key` を指定する場合、各分岐は一意となる `key` を使用する必要があることです。ほとんどの場合、これらの `key` は削除できます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaking change は重大な変更ではなく破壊的変更です 🤖

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

破壊的変更 に修正しました。
d05ecfd

てにをはも1ヶ所、見直しました。
各分岐は一意となる -> 各分岐に一意となる

@ryoAccount
Copy link
Collaborator Author

@potato4d
レビューいただきありがとうございました。
指摘箇所を修正しました。
d05ecfd

Copy link
Member

@potato4d potato4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@potato4d potato4d merged commit cd444b6 into vuejs-jp:lang-ja Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration Guide > key attribute の翻訳
2 participants